package com.huawei.appgallery.wishwall.ui.cardkit.card;

import android.content.Context;
import android.graphics.Rect;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import com.huawei.appgallery.foundation.card.base.card.BaseDistCard;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import o.cgz;
import o.ddq.d;
import o.epv;

public class WishWallDetailEmptyCard extends BaseDistCard {
    private int ʻ = 180;
    private LinearLayout ˋ;

    public WishWallDetailEmptyCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        this.ˋ = (LinearLayout) view.findViewById(d.ʽˋ);
        ʽ(view);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        ˊ();
    }

    private void ˊ() {
        this.ˋ.post(new Runnable(this) {
            final /* synthetic */ WishWallDetailEmptyCard ˊ;

            {
                this.ˊ = r1;
            }

            public void run() {
                int[] iArr = new int[2];
                this.ˊ.ˋ.getLocationInWindow(iArr);
                int height = iArr[1] + this.ˊ.ˋ.getHeight();
                Rect rect = new Rect();
                this.ˊ.ˋ.getWindowVisibleDisplayFrame(rect);
                int height2 = (rect.height() + this.ˊ.ॱ(this.ˊ.ˉ().getContext())) - epv.ˋ(this.ˊ.ˉ().getContext(), 68);
                if (height2 > height) {
                    LayoutParams layoutParams = this.ˊ.ˋ.getLayoutParams();
                    layoutParams.height = (height2 - height) + this.ˊ.ˋ.getHeight();
                    this.ˊ.ˋ.setLayoutParams(layoutParams);
                    return;
                }
                LayoutParams layoutParams2 = this.ˊ.ˋ.getLayoutParams();
                layoutParams2.height = epv.ˋ(this.ˊ.ˉ().getContext(), this.ˊ.ʻ);
                this.ˊ.ˋ.setLayoutParams(layoutParams2);
            }
        });
    }

    private int ॱ(Context context) {
        int identifier = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
        if (identifier > 0) {
            return context.getResources().getDimensionPixelSize(identifier);
        }
        return 0;
    }
}
